package org.azj.logHelper;
import java.io.IOException;


class LogHelper {
	private ILogger logFile;
	private LOG_LEVEL logLevel;
	private LOG_COMPONENT logComponent;
	
	public LogHelper(String fileName) throws IOException
    {
		logLevel = LOG_LEVEL.INFORMATION;
		logComponent = LOG_COMPONENT.LOG_COMP_COMMON;
        logFile = new LogFile(fileName, logLevel, logComponent);
    }
	
	public LogHelper(String fileName, LOG_LEVEL defaultLevel, LOG_COMPONENT defaultComponent)  throws IOException
    {
		logLevel = defaultLevel;
		logComponent = defaultComponent;
        logFile = new LogFile(fileName, defaultLevel, defaultComponent);
    }
	
	public void Enable()
    {
        logFile.Enable();
    }

    public void Disable()
    {
        logFile.Disable();
    }

    public void SetLogLevel(LOG_LEVEL level)
    {
        logFile.SetLogLevel(level);
    }

    public String GetLogFolderPath()
    {
        return logFile.GetLogFolderPath();
    }

    public String WriteLog(LOG_LEVEL eLogLevel, LOG_COMPONENT component, String message) throws IOException
    {
        return logFile.WriteLog(eLogLevel, component, message);
    }

    public void WriteLog(String message) throws IOException
    {
        logFile.WriteLog(message);
    }

    public void Dispose() throws IOException
    {
        logFile.DisposeLog();
    }
}
